#! /usr/bin/env python
# -*- coding:utf-8 -*-
#author:无涯

import  os

def base_dir():
	return os.path.dirname(os.path.dirname(__file__))



def filePath(directory='data',fileName=None):
	return os.path.join(base_dir(),directory,fileName)


def wtiteID(fileName=None,content=None):
	'''
	把动态参数写到文件中
	:param fileName: 具体的文件名称
	:param content:  被写到文件中的目标内容
	:return:
	'''
	with open(filePath(fileName=fileName),'w') as f:
		f.write(str(content))



def readID(fileName=None):
	'''
	读取动态参数
	:param fileName: 存储动态参数的文件名称
	:return:
	'''
	with open(filePath(fileName=fileName)) as f:
		return f.read()

